home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_098 / hddriver / driver / misc.asm < prev    next >
Assembly Source File  |  1992-05-06  |  1KB  |  56 lines

  1. ;
  2. ; copy_sector(from,to)
  3. ; ULONG *from,*to;
  4. ;
  5. ; Copies 128 words (512 bytes) of memory
  6. ;
  7.     XDEF    _copy_sector
  8.  
  9. _copy_sector:
  10.     move.l    4(sp),a0
  11.     move.l    8(sp),a1
  12.     move.w    #128,d0
  13. loop
  14.     move.l    (a0)+,(a1)+
  15.     subq.w    #1,d0
  16.     bne     loop
  17.     rts
  18.  
  19. ;
  20. ; Dummy segment list for subprocess
  21. ;
  22.     XDEF    _proc_seg_list
  23.     XREF    _subprocess
  24.  
  25.     cnop    0,4        ; long word allign
  26.     dc.l    16        ; segment length - any number will do
  27. _proc_seg_list
  28.     dc.l    0        ; next segment
  29.     jmp        _subprocess
  30.  
  31. ;
  32. ; Routines used by wd.c to read and write sectors.
  33. ;
  34.     XDEF    _rdsec
  35.     XDEF    _wrsec
  36.  
  37. _rdsec                    ; rdsec(buf,&WD->data,size)
  38.     move.l    4(sp),a0    ; buf
  39.     move.l    8(sp),a1    ; controller data register
  40.     move.l    12(sp),d0    ; bytes to transfer
  41. rdsec2
  42.     move.b (a1),(a0)+    ; read byte into buffer
  43.     subq.l #1,d0        ; subtract 1
  44.     bne rdsec2            ; loop till all bytes read
  45.     rts
  46.  
  47. _wrsec                    ; wrsec(buf,&WD->data,size)
  48.     move.l    4(sp),a0    ; buf
  49.     move.l    8(sp),a1    ; controller data register
  50.     move.l    12(sp),d0    ; bytes to transfer
  51. wrsec2
  52.     move.b (a0)+,(a1)    ; write byte to controller
  53.     subq.l #1,d0        ; subtract 1
  54.     bne wrsec2            ; loop till all bytes written
  55.     rts
  56.